package com.suixinsanren.design.proxy.demo.demo03;

import org.junit.Test;

public class DuckProxyTestDrive {

    @Test
    public void test() {
        DuckProxy duck = new DuckProxy(new WildDuck());
        duck.quack();
        duck.fly();
        duck.quack();
        duck.quack();
        duck.fly();

        System.out.println("叫了" + duck.getQuackCounter() + "次");
        System.out.println("飞了" + duck.getFlyCounter() + "次");
    }
}
